package com.vne.skyemart.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "Brand",catalog = "skyemart_db")
public class Brand implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 853484208373150526L;
		
	@Id
	@GeneratedValue
	@Column(name = "BrandID",nullable = false,unique = true)
	private int brandID;
	
	@Column(name = "BrandName",length = 50)
	private String brandName;
	
	@Column(name = "Description",length = 250)
	private String description;
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "brand")
	private Set<CategoriesProduct> categoriesProduct = new HashSet<CategoriesProduct>(0);
	/**
	 * CONSTRUCTOR
	 * 
	 */
	public Brand() {}
	
	public Brand(int brandID, String brandName, String description,
			Set<CategoriesProduct> categoriesProduct) {
		super();
		this.brandID = brandID;
		this.brandName = brandName;
		this.description = description;
		this.categoriesProduct = categoriesProduct;
	}
	/**
	 * GETTER AND SETTER
	 * 
	 */
	public int getBrandID() {
		return brandID;
	}
	public void setBrandID(int brandID) {
		this.brandID = brandID;
	}
	public String getBrandName() {
		return brandName;
	}
	public void setBrandName(String brandName) {
		this.brandName = brandName;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Set<CategoriesProduct> getCategoriesProduct() {
		return categoriesProduct;
	}
	public void setCategoriesProduct(Set<CategoriesProduct> categoriesProduct) {
		this.categoriesProduct = categoriesProduct;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
}
